<!doctype html>
<html>

<head>
	<meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

	<meta http-equiv="pragma" content="no-cache">
	<!-- HTTP 1.0 -->
	<meta http-equiv="cache-control" content="no-cache">

	<meta charset="utf-8">
	<link rel="stylesheet" href="{MODULE_URL}resource/css/style.css" /> {if $color!=""}
	<link rel="stylesheet" href="{MODULE_URL}resource/css/{$color}.css" /> {/if}
	<script type="text/javascript" src="{MODULE_URL}resource/js/jquery-2.1.4.min.js"></script>
	<title>{$huodongname}</title>
	{php echo register_jssdk();}
	<script type="text/javascript">
		var ua = navigator.userAgent.toLowerCase();
		var isWeixin = ua.indexOf('micromessenger') != -1;
		var isAndroid = ua.indexOf('android') != -1;
		var isIos = (ua.indexOf('iphone') != -1) || (ua.indexOf('ipad') != -1);
		if (!isWeixin) {
			//document.head.innerHTML =
			//'<title>抱歉，出错了</title><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0"><link rel="stylesheet" type="text/css" href="https://res.wx.qq.com/open/libs/weui/0.4.1/weui.css">';
			//	document.body.innerHTML =
			//'<div class="weui_msg"><div class="weui_icon_area"><i class="weui_icon_info weui_icon_msg"></i></div><div class="weui_text_area"><h4 class="weui_msg_title">请在微信客户端打开链接</h4></div></div>';
		}
	</script>
</head>

<body>
	<div class="home">
		<div class="top">
			<div class="ava">
				<!-- 
			   <img src="{MODULE_URL}resource/images/avatar/img.jpg" alt="">
			    -->
				<img src="{$headimg}" alt="">
				<a class="icon-rank" style="top:3rem; right:20px;" href="{php echo $this->createMobileUrl('ranking',array('rid'=>$rid));}"> </a>
				<!-- 
				<a class="icon-rank2" style="top:3rem; left:20px;" href="http://kelanguoji.mikecrm.com/JfyH3pD"> </a>
				 -->
				
			</div>
			<h2>答对
				<span>3</span> 题并转发答案揭秘即可领取现金宝藏</h2>
			<!--btn-->
			<div class="play">
				<a href="#" onclick="startto()">
					开始答题
				</a>
			</div>
			<h3>现金宝藏累积：{$dtuser_points_counts}元</h3>
			<h4>
				<a href="{php echo $this->createMobileUrl('exchange',array('rid'=>$rid));}">兑换宝藏</a>
				<a href="javascript:void(0);" class="show_popup">活动规则</a>
			</h4>

		</div>
		<div class="tiku">
			<a href="{php echo $this->createMobileUrl('goshare',array('rid'=>$rid));}">
				<img src="{MODULE_URL}resource/images/tiku.jpg" alt="">
			</a>
		</div>
		<div class="list-block media-list">
			<ul>


				<?php $i=1; ?> {loop $userlist $row}
				<li>
					<a href="#" class="item-content">
						<div class="item-media">
							<img src="{$row['headimg']}">
						</div>
						<div class="item-inner">
							<div class="item-title-row">
								<div class="item-title">{$row['nick']}</div>
								<div class="item-after red">成功领取</div>
							</div>
							<div class="item-title-row gray">
								<div class="item-subtitle">答对3道题，成功领取现金{$row['points']}元</div>
								<div class="item-after">{php echo date("Y/m/d H:i",$row['pointstime'])}</div>
							</div>
						</div>
					</a>
				</li>
				{/loop}
			</ul>
		</div>
	</div>

	<!--问答提示 start-->
	<div class="result" id="nocount" style="display:none;">


		<div class="box">
			<div class="txt" style="color:red;"><p><i class="iconfont">&#xe607;</i></p><p>今日答题次数已用尽</p><p>明日再来吧</p></div>
		</div>




	</div>
	<!--问答提示 end-->
	<!--share-->
	<div class="tips">
		<img src="{MODULE_URL}resource/images/guide.gif" width="100%">
	</div>


	<!--活动介绍 start-->
	<div class="popup" style="display:none ;">
		<div class="pcontent">
			<div class="tit f16">
				<div class="close fr">
					<i class="iconfont">&#xe606;</i>
				</div>
				<h2 class="f16">活动介绍</h2>
			</div>
			<div class="txtBox">
				<p>{$huodongdesc}</p>
			</div>
		</div>
	</div>

	<!--活动介绍 end-->

	<script>
		$(document).ready(function () {
			//活动介绍
			$(".show_popup").click(function () {
				$(".popup").show(0);
			})
			$(".popup .close").click(function () {
				$(".popup").hide(0);
			})
			$(".share,.tips").click(function () {
				$(".tips").toggle(0);
			})

			$("#nocount").click(function () {
				$("#nocount").hide(0);
			})
			$(".close").click(function () {
				$(this).closest(".result").hide(0);
			})
		})

		function startto() {
			var usershare=parseInt({$usershare});
			if (parseInt({$shyucount}) <= 0) {
				$("#nocount").show();
			} else {
				
				if(usershare==0){
					//if(confirm("您还没有分享必考题页面,目前无法领取宝藏，您确认要先答题吗？")==true){
					//var url = "{php echo $this->createMobileUrl('dati')}";
					//var rid = '{$rid}';
					//var fromid = '{$fromid}';
					//location.href = url + "&rid=" + rid + "&fromid=" + fromid;
					//}else{
					//	return false;
					//}
					
				     alert('您还没有分享必考题页面,目前无法领取宝藏，请先分享考题页面');
				      var url = "{php echo $this->createMobileUrl('goshare',array('rid'=>$rid));}";
				     
					   location.href = url;
					
				}else{
					if(confirm("每天有一次答题机会，中切勿退出，确定要开始答题吗？")){	
						var url = "{php echo $this->createMobileUrl('dati')}";
						var rid = '{$rid}';
						var fromid = '{$fromid}';
						location.href = url + "&rid=" + rid + "&fromid=" + fromid;
					}	
				}
				
			}
		}

		function seeme() {
			var rid = '{$rid}';
			var url = "{php echo $this->createMobileUrl('chengji')}";
			location.href = url + "&rid=" + rid + "&nocount=1";
		}

		wx.ready(function () {
			sharedata = {
				title: "{$sharetitle} ",
				desc: "{$sharecontent}",
				link: "{$sharelink}",
				imgUrl: "{$shareimg}"
			};
			wx.onMenuShareAppMessage(sharedata); //分享给朋友
			wx.onMenuShareTimeline(sharedata); //分享到朋友圈
			wx.showOptionMenu(); //显示右上角按钮
		});
	</script>
</body>

</html>